package com.ruoyi.post.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.mapper.SysUserPostMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/app/dept")
public class PostController {

    @Autowired
    private SysUserPostMapper userPostMapper;

    @GetMapping("/dept/list")
    public AjaxResult list(){
        List<Long> longList = userPostMapper.selectUserIdsByPostId();
        return AjaxResult.success(longList);
    }

    @GetMapping("/dept/user")
    public AjaxResult user(){
        List<SysUser> sysUsers = userPostMapper.selectUserByPostId();
        return AjaxResult.success(sysUsers);
    }

}
